package houseHold;

import houseHold.electricObjects.ElectricObject;
import houseHold.electricObjects.ElectricObjectType;
import houseHold.gasObjects.GasObject;
import houseHold.gasObjects.GasObjectType;
import houseHold.waterObjects.WaterObject;
import houseHold.waterObjects.WaterObjectType;
import consumption.ConsumptionType;

public class HouseHoldObjectFactory {
	public static HouseHoldObject getObject(ConsumptionType type,
			HouseHoldObject old) {
		HouseHoldObject object = null;
		if (type == ConsumptionType.ELECTRICITY)
			object = new ElectricObject(old);
		if (type == ConsumptionType.GAS)
			object = new GasObject(old);
		if (type == ConsumptionType.WATER)
			object = new WaterObject(old);
		return object;
	}

	public static HouseHoldObject getObject(ObjectType type) {
		HouseHoldObject object = null;
		if (type instanceof ElectricObjectType)
			object = new ElectricObject();
		if (type instanceof GasObjectType)
			object = new GasObject();
		if (type instanceof WaterObjectType)
			object = new WaterObject();
		return object;
	}
}
